import Vue from "vue"
import VueRouter from "vue-router"
import BookManage from "../components/BookManage";
import addBook from "../components/addBook";
import updateBook from "../components/updateBook";
import Index from "../components/index"

Vue.use(VueRouter)

const routes = [
  {
    path:"/",
    name:"图书管理",
    component:Index,
    redirect:"/BookManage",
    children:[
      {
        path:"/BookManage",
        name:"查询图书",
        component:BookManage,
        show:true
      },
      {
        path:"/addBook",
        name:"添加图书",
        component:addBook,
        show:true
      },
      {
        path: "/update",
        name: "修改图书",
        component: updateBook,
        show:false
      }
    ]
  }

]
const router =  new VueRouter({
  model: 'history',
  routes
});
export default router
